/**
 *Copyright (c) 2024 watereyes
 * safetymanagement is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */

package com.koron.risk.mapper;



import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface AnalysisMapper {
    Map getDangerousOperationAnalysis(@Param("codeList") List<String> codeList);

    Map queryCountDangerByGrid(@Param("nomarlDangerCount") String nomarlDangerCount, @Param("importantDangerCount") String importantDangerCount,
                               @Param("managerDangerCount") String managerDangerCount, @Param("deviceDangerCount") String deviceDangerCount, @Param("meterialDangerCount") String meterialDangerCount,
                               @Param("personDangerCount") String personDangerCount, @Param("GoodsDangerCount") String GoodsDangerCount,
                               @Param("enviropmentDangerCount") String enviropmentDangerCount, @Param("codeList") List<String> codeList);

    Map queryCountDangerPrecautionByGrid(@Param("unreformCount") String unreformCount, @Param("alreadyReformCount1") String alreadyReformCount1,
                                         @Param("reformingCount") String reformingCount, @Param("alreadyReformCount2") String alreadyReformCount2,
                                         @Param("codeList") List<String> codeList);

    /**
     * 风险统计,一般风险，较低风险，较大风险，重大风险
     * @param codeList
     * @return
     */
    Map  queryCountRiskHazardSourceByGrid(@Param("codeList") List<String> codeList);

    Map queryCountHazradByGrid(@Param("majorHazardSource") String majorHazardSource, @Param("codeList") List<String> codeList);

    /**
     * 获取公司下演练统计数据，演练场次及演练参与人数
     *
     * @param startDate 开始时间
     * @param stopDate 截至时间
     * @param codeList 公司code
     * @return
     */
    Map getDrillAnalysis(@Param("startDate") Date startDate, @Param("stopDate") Date stopDate, @Param("codeList") List<String> codeList);

    /**
     * 获取演练类型
     *
     * @param startDate 开始时间
     * @param stopDate 截至时间
     * @param codeList 公司code
     * @return
     */
    List<Map> getDrillTypeAnalysis(@Param("startDate") Date startDate, @Param("stopDate") Date stopDate, @Param("codeList") List<String> codeList);

    /**
     * 获取培训次数和参与人数
     *
     * @param startDate 开始时间
     * @param stopDate 截至时间
     * @param codeList 公司code
     * @return
     */
    Map getTrainAnalysis(@Param("startDate") Date startDate, @Param("stopDate") Date stopDate, @Param("codeList") List<String> codeList);

    /**
     * 获取所有的有考试成绩的数据
     * @param startDate 开始时间
     * @param stopDate 截至时间
     * @param codeList 公司code
     * @return
     */
    List<Map> getTrainScoreAnalysis(@Param("startDate") Date startDate, @Param("stopDate") Date stopDate, @Param("codeList") List<String> codeList);

    /**
     * 查风险类型数据
     * @param codeList 公司code
     * @return
     */
    List<Map> getHazardType(@Param("codeList") List<String> codeList);

    /**
     * 查询风险统计数据
     * @param hazardSourceIdList 危险源id
     * @return
     */
    Map getCountRiskHazardSourceByHazardSourceId(@Param("hazardSourceIdList") List<String> hazardSourceIdList);

    /**
     * 获取单位下最新的三个作业票
     * @param codeList
     * @return
     */
    List<String> getDangerousOperation(@Param("codeList") List<String> codeList);

    Map<String, Object> queryDangerAnalysisWithDate(@Param("startDate") Date startDate, @Param("stopDate") Date stopDate, @Param("codeList") String codeList);

}
